<template>
  <div class="BusinessEvaluation">
    <div class="empty" v-show="false">
      该店铺暂无评价
    </div>
    <div class="evaluation-content">
      <div class="evaluation-type">
        <p v-for="(x,y) in typeList" :class="showType==y?'evaluation-type-ped evaluation-type-p':'evaluation-type-p'" @click="showTypeCallBack(y)">{{x}}</p>
      </div>
      <div class="evaluation-items">
        <div class="comment-box">
          <div class="comment-box-top">
            <div class="comment-box-img">
              <img src="../../../../static/img/uhead.jpg" alt="">
              <div class="comment-box-name">
                <span>代码搬运工</span>
                <div class="star">
                  <van-rate allow-half v-model="9.5/2" readonly color="#FF7005" />
                </div>
              </div>
            </div>
            <div class="comment-box-time">
              <p>04-30 14:43</p>
            </div>
          </div>
          <div class="comment-box-info" @click="jump('CommentDetails')">
            这个蛋糕真的超级好吃，香甜细腻，这个味的真的不要太好
            吃！！一定要试试！！
          </div>
          <div class="comment-img" @click="jump('CommentDetails')">
            <img :src="`../../../../static/img/es${x}.png`" alt="" v-for="x in [1,2,3,1,2,3]" :style="{marginRight:(x+1)%4==0?0:'.15rem'}">
          </div>
          <div class="comment-box-icon">
            <p>口味5星/包装5星/配送满意</p>
            <div>
              <p @click="thisComment=!thisComment"><img :src="thisComment?'../../../static/img/tz1ed.png':'../../../static/img/tz1.png'" alt=""><span>356</span></p>
              <p><img src="../../../../static/img/tz2.png" alt=""><span>356</span></p>
            </div>
          </div>
        </div>
        <div class="comment-box">
          <div class="comment-box-top">
            <div class="comment-box-img">
              <img src="../../../../static/img/uhead.jpg" alt="">
              <div class="comment-box-name">
                <span>代码搬运工</span>
                <div class="star">
                  <van-rate allow-half v-model="9.5/2" readonly color="#FF7005" />
                </div>
              </div>
            </div>
            <div class="comment-box-time">
              <p>04-30 14:43</p>
            </div>
          </div>
          <div class="comment-box-info">
            这个蛋糕真的超级好吃，香甜细腻，这个味的真的不要太好
            吃！！一定要试试！！
          </div>
          <div class="comment-img">
            <img :src="`../../../../static/img/es${x}.png`" alt="" v-for="x in [1,2,3,1,2,3]" :style="{marginRight:(x+1)%4==0?0:'.15rem'}">
          </div>
          <div class="comment-box-icon">
            <p>口味5星/包装5星/配送满意</p>
            <div>
              <p @click="thisComment=!thisComment"><img :src="thisComment?'../../../static/img/tz1ed.png':'../../../static/img/tz1.png'" alt=""><span>356</span></p>
              <p><img src="../../../../static/img/tz2.png" alt=""><span>356</span></p>
            </div>
          </div>
        </div>
        <div class="comment-box">
          <div class="comment-box-top">
            <div class="comment-box-img">
              <img src="../../../../static/img/uhead.jpg" alt="">
              <div class="comment-box-name">
                <span>代码搬运工</span>
                <div class="star">
                  <van-rate allow-half v-model="9.5/2" readonly color="#FF7005" />
                </div>
              </div>
            </div>
            <div class="comment-box-time">
              <p>04-30 14:43</p>
            </div>
          </div>
          <div class="comment-box-info">
            这个蛋糕真的超级好吃，香甜细腻，这个味的真的不要太好
            吃！！一定要试试！！
          </div>
          <div class="comment-img">
            <img :src="`../../../../static/img/es${x}.png`" alt="" v-for="x in [1,2,3,1,2,3]" :style="{marginRight:(x+1)%4==0?0:'.15rem'}">
          </div>
          <div class="comment-box-icon">
            <p>口味5星/包装5星/配送满意</p>
            <div>
              <p @click="thisComment=!thisComment"><img :src="thisComment?'../../../static/img/tz1ed.png':'../../../static/img/tz1.png'" alt=""><span>356</span></p>
              <p><img src="../../../../static/img/tz2.png" alt=""><span>356</span></p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>

  import Vue from 'vue';
  import {ActionSheet, popup} from 'vant';

  Vue.use(ActionSheet);
  Vue.use(popup);
  export default {
    name: "BusinessEvaluation",
    data() {
      return {
        typeList:['全部','好评','中评','差评'],
        showType:0,
        thisComment:false // 当前是否点赞
      }
    },
    methods: {
      showTypeCallBack(num){
        this.showType = num;
      },
      jump(page){
        this.$router.push({
          name:page
        })
      }
    }
  }
</script>

<style scoped>
  .BusinessEvaluation {
    width: 100%;
    font-family: PingFang SC;
  }

  .empty {
    height: 2rem;
    line-height: 2rem;
    font-size: .16rem;
    text-align: center;
    font-family: PingFang SC;
    color: #999999;
  }

  .evaluation-content {
    background-color: #F5F5F5;
  }
  .evaluation-type {
    background-color: #FFFFFF;
    padding: .1rem .15rem;
    display: flex;
    flex-flow: row;
    align-content: center;
  }
  .evaluation-type-p {
    padding: 0 .13rem;
    height:.25rem;
    text-align: center;
    font-size:.14rem;
    font-family:PingFang SC;
    font-weight:500;
    line-height: .25rem;
    color: #999999;
    background-color: #F3F3F4;
    margin-right: .1rem;
  }
  .evaluation-type-ped {
    background-color: #FF8B3B;
    color: #FFFFFF;
  }
  .comment-box {
    background-color: #FFFFFF;
    padding: .15rem .15rem 0;
    margin-bottom: .1rem;
  }
  .comment-box-top {
    display: flex;
    flex-flow: row;
    align-items: center;
    justify-content: space-between;
  }
  .comment-box-img {
    display: flex;
    flex-flow: row;
    align-items: center;
  }
  .comment-box-img>img {
    width: .35rem;
    height: .35rem;
    border-radius: 50%;
    margin-right: .13rem;
  }
  .comment-box-name {
    height: .35rem;
    display: flex;
    flex-flow: column;
    justify-content: space-between;
  }
  .comment-box-name>span {
    font-size:.14rem;
    font-family:PingFang SC;
    font-weight:bold;
    color: #4E4E4E;
  }
  .comment-box-name>.star {
    margin: 0;
  }
  .comment-box-time {
    display: flex;
    flex-flow: column;
    justify-content: space-between;
  }
  .comment-box-time>p {
    text-align: right;
    font-size:.12rem;
    font-family:PingFang SC;
    font-weight:500;
    color: #B5B5B5;
  }
  .comment-box-info {
    padding-left: .15rem;
    font-size:.13rem;
    font-family:PingFang SC;
    font-weight:500;
    color:rgba(98,98,98,1);
    line-height:.2rem;
    margin: .15rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
  }
  .comment-img {
    padding-left: .15rem;
    display: flex;
    flex-flow: row wrap;
    align-items: center;
  }
  .comment-img>img {
    width: 1rem;
    height: .7rem;
    margin-right: .15rem;
    margin-bottom: .1rem;
  }
  .comment-box-icon {
    padding-left: .15rem;
    height: .4rem;
    display: flex;
    flex-flow: row;
    align-items: center;
    justify-content: space-between;
  }
  .comment-box-icon>p:nth-child(1) {
    text-align: right;
    font-size:.12rem;
    font-family:PingFang SC;
    font-weight:500;
    color: #B5B5B5;
  }
  .comment-box-icon>div>p {
    padding: 0 .1rem;
    height:.22rem;
    background:rgba(255,255,255,1);
    border:.01rem solid rgba(204, 204, 204, 1);
    border-radius:.11rem;
    display: flex;
    flex-flow: row;
    align-items: center;
    justify-content: center;
    margin-left: .1rem;
  }
  .comment-box-icon>div {
    display: flex;
    flex-flow: row;
    align-items: center;
  }
  .comment-box-icon>div>p>span {
    font-size:.11rem;
    font-family:PingFang SC;
    font-weight:500;
    color: #808080;
  }
  .comment-box-icon>div>p>img {
    width: .13rem;
    height: .13rem;
    margin-right: .05rem;
  }



  /* 评分适配 */
  >>> .van-rate__icon {
    font-size: .11rem;
  }
  >>> .van-rate__item:not(:last-child) {
    padding-right: .04rem;
  }

  /* 进度条适配 */
  /deep/ .el-progress-bar__outer {
    background-color: #EBEBEB !important;
    border-radius: 1rem;
    height: .06rem !important;
  }
  >>> .el-progress-bar__inner {
    border-radius: 1rem;
  }
  /deep/ .el-progress-bar {
    width: 92%;
    padding-right: .2rem;
    margin-right: -.55rem;
  }
  /deep/ .el-progress__text {
    font-size:.1rem !important;
    color: #999999;
    font-family:PingFang SC;
    font-weight:400;
    margin-left: .4rem;
  }

</style>
